<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        $url="http://m.weather.com.cn/data/101190101.html";
        if(!$text=file_get_contents($url)){
            echo "not open the url";
        }
        $content=  json_decode($text,TRUE);
        $obj=  json_decode($text);
        echo '<pre>';
        //print_r($content);
        echo $content['weatherinfo']['city']."\n";
        echo $obj->{'weatherinfo'}->{"weather1"}."\n";
        echo $content['weatherinfo']['temp1']."\n";
        echo $content['weatherinfo']['wind1']."\n";
        echo '着衣建议:'.$content['weatherinfo']['index_d']."\n";
        echo "</pre>";
        ?>
    </body>
</html>
